#include <iostream>

using namespace std;

#include "random.h"
#include "cluster.h"

int main() {
  Cluster p, q;
  for (int i = 0; i < 2; ++i) {
    Point point;
    for (int k = 0; k < CH; ++k) {
      point[k] = char(urandom() * 256);
    }
    p += point;
  } 
  for (int i = 0; i < CH; ++i) {
    double sum = 0.0;
    for (int j = 0; j < CH; ++j) {
      cout << p.covariance(i, j) << '\t';
      sum += p.covariance(i, j);
    }
    cout << "    " << sum << endl;
  }
  for (int i = 0; i < 256; ++i) {
    Point point;
    for (int k = 0; k < CH; ++k) {
      point[k] = char(urandom() * 256);
    }
    q += point;
  } 
  cout << distance_mah(p, q) << endl;
  return 0;
}
